/**
 *
 */
package com.pocketsweet.model;

import com.avos.avoscloud.AVClassName;
import com.avos.avoscloud.AVFile;
import com.avos.avoscloud.AVObject;
import com.pocketsweet.utils.ToolKits;

/**
 * @author hantian
 */
@AVClassName("MLGift")
public class MLGift extends AVObject {
    // //////////////////////////////////////////
    // 常量
    // //////////////////////////////////////////
    public static String NAME = "name";// 礼物名称
    public static String IMG = "img";// 礼物图片URL
    public static String STATUS = "status";// 状态值，0:下架，1:上线
    public static String INFO = "info";// 介绍
    public static String PRICE = "price";// 价格
    public static String PRIORITY = "priority";// 优先级

    public MLGift() {
        // super.alwaysUseSubUserClass(MLUser.class);
    }

    // 礼物名称
    public String getName() {
        return ToolKits.replaceBlank(super.getString(NAME));
    }

    public void setName(String value) {
        super.put(NAME, value);
    }

    // 礼物图片
    public AVFile getImg() {
        return super.getAVFile(IMG);
    }

    public void setImg(AVFile value) {
        super.put(IMG, value);
    }

    public String getImgUrl() {
        AVFile avatar = getImg();
        if (avatar != null) {
            return avatar.getUrl();
        } else {
            return null;
        }
    }

    // 礼物状态
    public int getStatus() {
        return super.getInt(STATUS);
    }

    public void setStatus(int value) {
        super.put(STATUS, value);
    }


    // 礼物详情
    public String getInfo() {
        return super.getString(INFO);
    }

    public void setInfo(String value) {
        super.put(INFO, value);
    }

    // 价格
    public void setPrice(double value) {
        super.put(PRICE, value);
    }

    public double getPrice() {
        return super.getDouble(PRICE);
    }

    public void setPriority(int value) {
        super.put(PRIORITY, value);
    }

    public double getPriority() {
        return super.getInt(PRIORITY);
    }

}
